import type { TableColumnCtx } from 'element-plus'
import { dayjs } from 'element-plus';
import store from '@/store';
interface GoodsReceiveListItem {
  goodsType: string;
  goodsName: string;
  goodsCode: string;
  receiveName: string;
  depositTerminal: string;
  receiveTime: string;
  userName: string;
}
export const goodsReceiveColumns = [
  { prop: 'index', type: 'index', label: '序号', width: 60, align: 'center' },
  {
    prop: 'goodsType',
    label: '物品类型',
    minWidth: 130,
    align: 'center',
    formatter: function (row:GoodsReceiveListItem, column:TableColumnCtx<GoodsReceiveListItem>, cellValue:string) {
      return store.getters['goodsType/getGoodsTypeName'](cellValue)
    }
  },
  { prop: 'goodsName', label: '物品名称', minWidth: 200, align: 'center' },
  { prop: 'goodsCode', label: '物品编号', minWidth: 120, sortable: true, align: 'center' },
  { prop: 'receiveName', label: '领取人', minWidth: 120, align: 'center' },
  { prop: 'depositTerminal', label: '航站楼【领取】', minWidth: 120, align: 'center' },
  {
    prop: 'receiveTime',
    label: '领取时间',
    sortable: true,
    minWidth: 180,
    align: 'center',
    formatter: function (row:GoodsReceiveListItem, column:TableColumnCtx<GoodsReceiveListItem>, cellValue:string) {
      return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss')
    }
  },
  { prop: 'userName', label: '记录人', minWidth: 120, align: 'center' },
  { prop: 'action', label: '操作', fixed: 'right', align: 'center' }
]
